[IA64] Provide pxm_to_node and node_to_pxm translation functions
authorAlex Williamson <alex.williamson@hp.com>
Tue, 12 Jun 2007 21:22:02 +0000 (15:22 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Tue, 12 Jun 2007 21:22:02 +0000 (15:22 -0600)
Required for NUMA node table setup on sn2.

Signed-off-by: Jes Sorensen <jes@sgi.com>
xen/arch/ia64/linux-xen/sn/kernel/setup.c
xen/arch/ia64/xen/acpi.c
xen/include/asm-ia64/linux-xen/asm/numa.h

index e1d48fa9fd50b4cc9f9a0ea3c01834dfd4609b0d..a62cf54de71927b55d067f90bce4b47aca71ceda 100644 (file)
 #include <asm/sn/klconfig.h>
 #ifdef XEN
 #include <asm/sn/shubio.h>
-
-/* Xen has no clue about NUMA ....  grrrr */
-#define pxm_to_node(foo)               0
-#define node_to_pxm(foo)               0
-#define numa_node_id()                 0
 #endif
 
 
index 516a6741c0a3041f10acd6374f4bbadfa042bfb1..61e01103fe03c66bd62f060c2dbf6542f0015ab1 100644 (file)
@@ -388,6 +388,24 @@ int __initdata pxm_to_nid_map[MAX_PXM_DOMAINS];
 int __initdata nid_to_pxm_map[MAX_NUMNODES];
 static struct acpi_table_slit __initdata *slit_table;
 
+#define NID_INVAL                      -1
+#define PXM_INVAL                      -1
+
+int __init pxm_to_node(int pxm)
+{
+       if (pxm < 0)
+               return NID_INVAL;
+       return pxm_to_nid_map[pxm];
+}
+
+int __init node_to_pxm(int node)
+{
+       if (node < 0)
+               return PXM_INVAL;
+       return nid_to_pxm_map[node];
+}
+
+
 /*
  * ACPI 2.0 SLIT (System Locality Information Table)
  * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
@@ -473,8 +491,8 @@ acpi_numa_arch_fixup (void)
        /* calculate total number of nodes in system from PXM bitmap */
        numnodes = 0;           /* init total nodes in system */
 
-       memset(pxm_to_nid_map, -1, sizeof(pxm_to_nid_map));
-       memset(nid_to_pxm_map, -1, sizeof(nid_to_pxm_map));
+       memset(pxm_to_nid_map, PXM_INVAL, sizeof(pxm_to_nid_map));
+       memset(nid_to_pxm_map, NID_INVAL, sizeof(nid_to_pxm_map));
        for (i = 0; i < MAX_PXM_DOMAINS; i++) {
                if (pxm_bit_test(i)) {
                        pxm_to_nid_map[i] = numnodes;
index 77b444c72c36d7b0ddcbb4be6d70c14963f47b08..640af474f820593f511e492491bce78c7794ad4d 100644 (file)
@@ -75,6 +75,8 @@ extern int paddr_to_nid(unsigned long paddr);
 
 #ifdef XEN
 #define phys_to_nid(paddr) paddr_to_nid(paddr)
+extern int pxm_to_node(int pxm);
+extern int node_to_pxm(int node);
 #endif
 
 #endif /* _ASM_IA64_NUMA_H */